<?php
include('lock.php');

$q="Select * FROM stock s INNER JOIN location l ON s.location";
$result=mysql_query($q);

echo"<table>";
echo"<tr>";
echo"<td>ID</td>";
echo"<td>email</td>";
echo"<td>name</td>";
echo"<td>dob</td>";
echo"<td>address</td>";
echo"<td>contact</td>";
echo"<td>join_date</td>";	
echo"<td>is_admin</td>";
echo"</tr>";

while($data_fetch=mysql_fetch_array($result))
{
	echo"<tr>";
	echo"<td>". $data_fetch['user_ID'] ."</td>";
	$id = $data_fetch['user_ID'];
	echo"<td>". $data_fetch['user_email'] ."</td>";
	echo"<td>". $data_fetch['user_name'] ."</td>";
	echo"<td>". $data_fetch['user_dob'] ."</td>";
	echo"<td>". $data_fetch['user_address'] ."</td>";
	echo"<td>". $data_fetch['user_contact'] ."</td>";
	echo"<td>". $data_fetch['join_date'] ."</td>";
	echo"<td>". $data_fetch['is_admin'] ."</td>";	
	echo"<td>";
	?>
	<form name="delete" action="MemberSQL.php" method="POST">
    <input type="hidden" name="deleteID" value="<?php echo "DELETE FROM user WHERE user_ID=$id"; ?>"/>
    <input type="submit" onClick="window.location.href=window.location.href" name="delete" value="Delete"/>
    </form>
	</td>
	<td>
	<form name="edit" action="MemberEdit.php" method="POST">
    <input type="hidden" name="editID" value="<?php echo "$id"; ?>"/>
    <input type="submit" name="edit" value="Edit"/>
    </form>
	
	<?php
	echo"</td>";
	echo"</tr>";
}

echo"</table>";
?>